package com.zyh.domain;

import java.io.Serial;
import java.io.Serializable;

/**
 * @Author zyh
 * @Date 2024/8/22 17:05
 * @Description
 */

public class Stu implements Serializable {
    @Serial
    private static final long serialVersionUID = 7223097242446233258L;
    private Integer sid;
    private String sname;
    private Integer age;
    private Double weight;
    private String address;
    private Integer classID;

    public Stu() {
    }

    public Stu(Integer sid, String sname, Integer age, Double weight, String address, Integer classID) {
        this.sid = sid;
        this.sname = sname;
        this.age = age;
        this.weight = weight;
        this.address = address;
        this.classID = classID;
    }

    public Integer getSid() {
        return sid;
    }

    public void setSid(Integer sid) {
        this.sid = sid;
    }

    public String getSname() {
        return sname;
    }

    public void setSname(String sname) {
        this.sname = sname;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Double getWeight() {
        return weight;
    }

    public void setWeight(Double weight) {
        this.weight = weight;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public Integer getClassID() {
        return classID;
    }

    public void setClassID(Integer classID) {
        this.classID = classID;
    }

    @Override
    public String toString() {
        return "Stu{" +
                "sid=" + sid +
                ", sname='" + sname + '\'' +
                ", age=" + age +
                ", weight=" + weight +
                ", address='" + address + '\'' +
                ", classID=" + classID +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Stu stu = (Stu) o;

        if (sid != null ? !sid.equals(stu.sid) : stu.sid != null) return false;
        if (sname != null ? !sname.equals(stu.sname) : stu.sname != null) return false;
        if (age != null ? !age.equals(stu.age) : stu.age != null) return false;
        if (weight != null ? !weight.equals(stu.weight) : stu.weight != null) return false;
        if (address != null ? !address.equals(stu.address) : stu.address != null) return false;
        return classID != null ? classID.equals(stu.classID) : stu.classID == null;
    }

    @Override
    public int hashCode() {
        int result = sid != null ? sid.hashCode() : 0;
        result = 31 * result + (sname != null ? sname.hashCode() : 0);
        result = 31 * result + (age != null ? age.hashCode() : 0);
        result = 31 * result + (weight != null ? weight.hashCode() : 0);
        result = 31 * result + (address != null ? address.hashCode() : 0);
        result = 31 * result + (classID != null ? classID.hashCode() : 0);
        return result;
    }
}
